Skip to content

[WIP] Improve Markdown Table formatting#4795

Draft
SougandhS wants to merge 1 commit intoeclipse-jdt:masterfrom
SougandhS:MarkdownTableFormatter
Draft

[WIP] Improve Markdown Table formatting#4795
SougandhS wants to merge 1 commit intoeclipse-jdt:masterfrom
SougandhS:MarkdownTableFormatter

Conversation

@SougandhS
Copy link
Member

@SougandhS SougandhS commented Jan 28, 2026

This commit aligns markdown table properly based on max length cell data (Center Aligned)

see https://github.github.com/gfm/#tables-extension- & https://openjdk.org/jeps/467

Input ->

/// | Item | Item | Item | Item | Item | Item |
/// | - | - | - | - | - | - |
/// | TextSougus  | sd  | ss | Item | Row1Col1 | Row1Col2 |
class Main {
}

output ->

/// |    Item    |    Item    |    Item    |    Item    |    Item    |    Item    |
/// |------------|------------|------------|------------|------------|------------|
/// | TextSougus |     sd     |     ss     |    Item    |  Row1Col1  |  Row1Col2  |
/// 
class Main {
}

input ->

/// | Txssdsss | It |
/// | - | - |
/// | TextSougus  | sd |
/// | sd  | TextSougus |
class Mark64 {
}

output ->

/// |  Txssdsss  |     It     |
/// |------------|------------|
/// | TextSougus |     sd     |
/// |     sd     | TextSougus |
/// 
class Mark64 {
}

What it does

How to test

Author checklist

This commit aligns markdown table properly based on max length cell data
@SougandhS SougandhS marked this pull request as draft January 28, 2026 06:47
@SougandhS
Copy link
Member Author

SougandhS commented Jan 28, 2026

@mateusz-matela I've been trying to align the table elements properly for some time, but I found few issues related wrap (Not sure) which causes some inputs to collapse

eg.

/// | Item sd |
/// | - | 
/// | TextSTezts  | 
class Main22 {
}

-> will formats to

/// |  Item sd
///            ||------------|
/// | TextSTezts |
/// 
class Main22 {
}

Do you have any suggestions on existing formatter APIs that would be suitable for this scenario ? or any different approach ?

@SougandhS
Copy link
Member Author

Please note - this aligns only for center, Left & Right is yet be handled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant